<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\StoreRoleBean;

class StoreRoleValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 StoreRoleBean::$id => 'require', //
			 StoreRoleBean::$storeId => 'require', //所属客户id
			 StoreRoleBean::$name => 'require|max:255', //角色名称
			 StoreRoleBean::$updatedAt => 'require', //
			 StoreRoleBean::$createdAt => 'require', //
		];
		$this->message = [
			StoreRoleBean::$id.POINST."require " => 'id必须', //
			StoreRoleBean::$storeId.POINST."require " => 'store_id必须', //所属客户id
			StoreRoleBean::$name.POINST."require " => 'name必须', //角色名称
			StoreRoleBean::$updatedAt.POINST."require " => 'updated_at必须', //
			StoreRoleBean::$createdAt.POINST."require " => 'created_at必须', //
		];
		$this->scene = [
			self::$all => [
				StoreRoleBean::$id,
				StoreRoleBean::$storeId,
				StoreRoleBean::$name,
				StoreRoleBean::$updatedAt,
				StoreRoleBean::$createdAt,
			],
			self::$add => [
                StoreRoleBean::$storeId,
                StoreRoleBean::$name,
			],
			self::$edit => [
                StoreRoleBean::$id,
                StoreRoleBean::$storeId,
                StoreRoleBean::$name,
			],
			self::$pkId => [
                StoreRoleBean::$id,
            ],

		];
	}


}
